#include<stdio.h>
#include<string.h>

int main() {

	char str[90];

	gets(str);

	int len = strlen(str);

	for (int i = 0; i < len; i++) {
		if (str[i] >= 'A' && str[i] <= 'Z') {
			str[i] = str[i] + 32;
		}
		else if (str[i] >= 'a' && str[i] <= 'z') {
			str[i] = str[i] - 32;
		}
	}
	
	puts(str);
	
	return 0;
}